package org.tigris.atlas.examples.factory;

import org.tigris.atlas.examples.service.ServiceFactory;
import org.tigris.atlas.examples.service.SimpleDomainService;
import org.tigris.atlas.examples.service.delegate.ServiceDelegateFactory;
import org.tigris.atlas.examples.service.delegate.SimpleDomainServiceDelegate;
import org.tigris.atlas.examples.transfer.SimpleDomain;
import org.tigris.atlas.examples.transfer.SimpleDomainPK;
import org.tigris.atlas.examples.transfer.TransferObjectFactory;

import junit.framework.TestCase;

public class TestFactories extends TestCase {

	public void testCreateTO() {
		SimpleDomain entity = (SimpleDomain) TransferObjectFactory.createTransferObject(SimpleDomain.ENTITY);
		assertNotNull(entity);
	}
	
	public void testCreatePK() {
		SimpleDomainPK pk = (SimpleDomainPK) TransferObjectFactory.createPrimaryKey(SimpleDomain.ENTITY);
		assertNotNull(pk);
	}
	
	public void testCreateServiceDelegate() {
		SimpleDomainServiceDelegate delegate = (SimpleDomainServiceDelegate) ServiceDelegateFactory.createService(SimpleDomainService.SERVICE_NAME);
		assertNotNull(delegate);
	}
	
	public void testCreateService() {
		SimpleDomainService service = (SimpleDomainService) ServiceFactory.createService(SimpleDomainService.SERVICE_NAME);
		assertNotNull(service);
	}
	
}
